home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / cellgame.swf / scripts / frame_2 / PlaceObject2_9_6 / CLIPACTIONRECORD onClipEvent(load).as < prev    next >
Encoding:
Text File  |  2006-06-13  |  524 b   |  19 lines

  1. onClipEvent(load){
  2.    if(_name != "amoebaShot")
  3.    {
  4.       _Y = _root.amoeba._y;
  5.       _X = _root.amoeba._x;
  6.       shotSpeed = 10;
  7.       shotTime = getTimer();
  8.       deltaX = _X - _root.ship._x;
  9.       deltaY = _Y - _root.ship._y;
  10.       angle = - Math.atan2(deltaX,deltaY);
  11.       ySpeed = shotSpeed * Math.cos(angle);
  12.       xSpeed = shotSpeed * Math.sin(angle);
  13.       amoebaShot = new Sound(this);
  14.       amoebaShot.attachSound("amoebaShot");
  15.       amoebaShot.setVolume(20);
  16.       amoebaShot.start();
  17.    }
  18. }
  19.